import Vue from "vue";
import VueRouter from "vue-router";

/* // 引入路由
import ShouYe from '../views/ShouYe.vue';
import Fenlei from '../views/Fenlei.vue';
import Car from '../views/Car.vue';
// 引入二级路由
import RenMenTuiJian from '../views/fenlei/RenMenTuiJian.vue'
import ShouJiShuMa from '../views/fenlei/ShouJiShuMa.vue'
import JingDongChaoShi from '../views/fenlei/JingDongChaoShi.vue' */
// 路由懒加载
// const ShouYe = ()=>import('../views/ShouYe.vue');
const FenLei = ()=> import('../views/Fenlei.vue');
const Car =()=> import('../views/Car.vue');
const JingDongChaoShi = ()=>import('../views/fenlei/JingDongChaoShi.vue');
const RenMenTuiJian = ()=> import('../views/fenlei/RenMenTuiJian.vue')
const ShouJiShuMa =()=>import('../views/fenlei/ShouJiShuMa.vue')


Vue.use(VueRouter);
let router = new VueRouter({
    mode:'hash',
    routes:[
        {
            path:'/shouye',
            name:'shouye',
            component:()=>import('../views/ShouYe.vue'),
            /* children:[
                {
                    path:'itemdetail/:id',
                    name:'itemdetail',
                    component:()=>import('../views/shouye/ItemDetail.vue'),
                    meta:{
                    }
                }
            ] */

        },
        {
            path:'/itemdetail/:id',
            name:'itemdetail',
            component:()=>import('../views/shouye/ItemDetail.vue'),
            meta:{
            }
        },
        {
            path:'/fenlei',
            name:'fenlei',
            component:FenLei,
            children:[
                {
                    path:'renmentuijian',
                    name:'renmentuijian',
                    component:RenMenTuiJian
                },
                {
                    path:'shoujishuma',
                    name:'shoujishuma',
                    component:ShouJiShuMa
                },
                {
                    path:'jingdongchaoshi',
                    name:'jingdongchaoshi',
                    component:JingDongChaoShi
                }
            ]
        },
        {
            path:'/car',
            name:'car',
            component:Car
        }
    ]
})
export default router;